package com.yinxin.thread;

import com.yinxin.util.ThreadUtil;

import java.util.Scanner;

/**
 * @author yinxin
 * @Title:
 * @Package
 * @Description:
 * @date 2022/1/79:30
 */
public class TestThread extends Thread {
    @Override
    public void run() {
        System.out.println("我是TestThread");
    }

    public static void main(String[] args) {
        while (true) {
            System.out.println("是否开始？请输入true开始执行");
            Scanner scanner = new Scanner(System.in);
            String flag = scanner.nextLine();
            if(flag.equals("true")){
                break;
            };
        }
        for (int i = 0; i < 100; i++) {
            ThreadUtil.sleep(100);
            TestThread testThread = new TestThread();
            testThread.start();
        }
    }

}
